package com.tboss.template.system.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.tboss.template.system.dto.OrganogramDto;
import com.tboss.template.system.service.OrganogramService;

@Controller
@RequestMapping(value = "/template/system/organogram")
public class OrganogramController {
	
	@Autowired private OrganogramService orgService;
	
	@RequestMapping(value = {"/_list{reqPage}", "/_list/{reqPage}", "/_listConts/{reqPage}"}, 
			method = {RequestMethod.POST, RequestMethod.GET})//
	public String organList(@PathVariable("reqPage") Integer reqPage, @ModelAttribute OrganogramDto dto,
			Model model, HttpServletRequest req){

		String rtnUrl = req.getServletPath().substring(1);		
		if(reqPage != null) rtnUrl = rtnUrl.substring(0, rtnUrl.lastIndexOf("/"));
		
		
		//this.orgService.setModelOrganList(reqPage, model, dto);
		
		return rtnUrl+"Ajax";
	}

}
